function [R1,R2,t1,t2,theta] = getCameraMatrixdecomp(E)


    % SVD of E
    [U,S,V] = svd(E);
    
    % Matrix W
    W = [0,-1,0;1,0,0;0,0,1];
        
    % Compute 4 possible solutions (p259)
    R1=U*W*V';
    R2=U*W'*V';
    
    if(det(R1)<0)
        R1=R1*-1.0;
    end
    
    if(det(R2)<0)
        R2=R2*-1.0;
    end
    
    t1=U(:,3)./max(abs(U(:,3)));
   t2=-U(:,3)./max(abs(U(:,3)));
    % theta is the angel between two vectors
    u = [0 0 1];
v = t1;
CosTheta = dot(u,v)/(norm(u)*norm(v));
theta = acos(CosTheta)*180/pi
    
end    
    
    
    
    
    
    
    
    
    
    
    
    
    